package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.query.EmployeeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    Employee checkName(String username);

    int queryForCount(EmployeeQueryObject qo);
    List<Employee> queryForList(EmployeeQueryObject qo);

    void changeState(Long id);
    //维护关系
    void insertRelation(@Param("empId") Long empId, @Param("roleId")Long roleId);

    //删除关系
    void deleteRelation(Long id);

    //修改密码
    int updatePasswordById(@Param("id") Long id,@Param("password") String password);


    Employee selectUsername(String uname);
}